package com.smcdd.cdb.dbo.cdb_dbo.network;

import com.smcdd.cdb.dbo.cdb_dbo.network.error_exception.ApiErrorHelper;
import com.smcdd.cdb.dbo.cdb_dbo.service.exception.ApiException;

import rx.Subscriber;

/**
 * Created by Jeremylee on 2017/6/5.
 */

public abstract class HttpObserver<T> extends Subscriber<T> implements OnRequestListener<T> {


    @Override
    public void onCompleted() {
    }


    @Override
    public void onNext(T t) {
        success(t);
    }

    @Override
    public void onError(Throwable e) {
        ApiErrorHelper.handleCommonError(e);
    }

    @Override
    public void onStart() {
    }

}
